package com.example.exceltosqlite.entity;

import android.os.Build;
import android.support.annotation.RequiresApi;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;
import java.util.Objects;

/**
 * Created by ColorRain on 2021/5/21.
 * 报文编号表
 */

//表名
@DatabaseTable(tableName = "telegramNumber")
public class SqliteFileNumberEntity implements Serializable {
    @DatabaseField(generatedId = true)
    private int id;
    @DatabaseField(columnName = "typeID")
    private int typeID; //关联 type表 id
    @DatabaseField(columnName = "messageNo")
    private String messageNo;
    @DatabaseField(columnName = "messageName")
    private String messageName;
    @DatabaseField(columnName = "date")
    private String date;


    public SqliteFileNumberEntity() {
    }


    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public int getTypeID() {
        return typeID;
    }

    public void setTypeID(int typeID) {
        this.typeID = typeID;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


    public String getMessageNo() {
        return messageNo;
    }

    public void setMessageNo(String messageNo) {
        this.messageNo = messageNo;
    }

    public String getMessageName() {
        return messageName;
    }

    public void setMessageName(String messageName) {
        this.messageName = messageName;
    }

    @Override
    public String toString() {
        return "SqliteFileNumberEntity{" +
                "typeID=" + typeID +
                ", messageNo='" + messageNo + '\'' +
                '}';
    }

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SqliteFileNumberEntity that = (SqliteFileNumberEntity) o;
        return typeID == that.typeID &&
                Objects.equals(messageNo, that.messageNo);
    }

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public int hashCode() {
        return Objects.hash(typeID, messageNo);
    }
}
